-module(misc_util).
-compile([export_all]).

-spec atom_to_binary(Atom :: atom()) -> binary().
atom_to_binary(Atom) ->
    <<131, 100, Len:2/unit:8, Bin:Len/binary>> = term_to_binary(Atom),
    Bin.

binary_to_atom(Bin) ->
    Len = byte_size(Bin),    
    binary_to_term(<<131, 100, Len:2/unit:8, Bin/binary>>).

